<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>CCHVC</title>
<link href="${BASE_PATH}/static/business/css/bootstrap.min.css" rel="stylesheet">
<link href="${BASE_PATH}/static/business/css/base.css" rel="stylesheet">
<link href="${BASE_PATH}/static/business/css/style.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="${BASE_PATH}/static/business/js/html5shiv.min.js"></script>
<script src="${BASE_PATH}/static/business/js/respond.min.js"></script>
<![endif]-->
<link href="${BASE_PATH}/static/business/css/jquery-ui.css" rel="stylesheet">
</head>
<body>
<!--内容开始-->
<div class="container">
	<center>
    <ol class="breadcrumb">
      <li class="active"><font color="red" size="+3">找回支付密码</font></li>
    </ol>
    </center>
    <div class="p-content f18">
        <form class="form-horizontal f15" id="myForm" method="post">                  
           <div class="form-group">
              <label class="col-sm-6 col-xs-4 control-label">账号：</label>
              <div class="col-sm-3  col-xs-4">
                 <input type="text" class="form-control" name="find_account" id="find_account" placeholder="手机号">
              </div>
           </div>
           <div class="form-group">
              <label class="col-sm-6 col-xs-4 control-label">支付密码：</label>
              <div class="col-sm-5  col-xs-7">
                 <input type="password" class="form-control" name="find_password" id="find_password" maxlength="6" placeholder="请输入支付密码">
              </div>
           </div>  
            <div class="form-group">
              <label class="col-sm-6 col-xs-4 control-label">确认密码：</label>
              <div class="col-sm-5  col-xs-7">
                 <input type="password" class="form-control" name="find_passwordConfirm" id="find_passwordConfirm" maxlength="6" placeholder="请确认密码">
              </div>
           </div>                  
            <div class="form-group">
              <div class="text-center">
                <div class="col-sm-5 col-sm-offset-6 col-xs-10 col-xs-offset-1">
                  <button type="button" class="btn btn-s btn-280" onclick="tj()">确            认</button>
                </div
              </div>
          </div>
        </form>
    </div>
</div>


<!-- 弹出层 -->
<!-- 支付密码设置成功 -->
<div class="modal fade" id="modal-15">
    <div class="modal-dialog modal-400">
        <div class="modal-content">
           <div class="modal-header">
               <a class="close" data-dismiss="modal">×</a>   
           </div>
           <div class="modal-body text-center">
                <span class="glyphicon glyphicon-ok ok"></span><br/>
                <p class="h4 mt20">密码找回成功</p>
           </div>
        </div>
    </div>
</div>
<script>

	function GetQueryString(name)
     {
     	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)","i");
     	var r = window.location.search.substr(1).match(reg);
     	if (r!=null) return (r[2]); return null;
     }
     function tj(){
     	var useid = $('#find_account').val();
     	var srxmm = $('#find_password').val();
     	var qrxmm = $('#find_passwordConfirm').val();
     	var mailyzm = GetQueryString("sid");
     	
     	if(''==useid){
     		alertMsgError("账号不能为空");
     		return;
     	}
     	if(''==srxmm){
     		alertMsgError("支付密码不能为空");
     		return;
     	}
     	if(''==qrxmm){
     		alertMsgError("确认密码不能为空");
     		return;
     	}
     	
     	
     	var array=[[/^[1-9][\d]{10}?$/,useid,"用户名不正确，请输入11位手机号"],[/^[\d]{6}?$/,srxmm,"支付密码格式错误，请输入6位数字密码"]];
		for(var	 i=0;i<array.length	;i++)
		{
			if(array[i][0].test(array[i][1])==false)
			{
				alertMsgError(array[i][2]);
				return;
			}
		}
     	
		$.ajax({
	            cache: true,
	            type: "POST",
	            url:"${BASE_PATH}/user/resetPayPwdWithMail.json",
	            dataType : 'json',
	            data:{useId:useid,newmm:srxmm,qrnewmm:qrxmm,mail_yzm:mailyzm},
	            async: false,
	            success: function(data){
	               if(data.result){
	               		alertMsgSuccess("重置支付密码成功");
	               		window.location.href="${BASE_PATH}";
                   }
	               else
	               {
	               	  for(var one in data.errors)
	                  alertMsgError(data.errors[one]);	
	               }
	           }
	        });
     } 
	
	//失败-错误,弹窗
	function alertMsgError(title){
		$('#modal-15 p').each(function(index){
			if(index==0){
				$(this).html("<font>"+title+"</font>");
			}
		})
		$('#modal-15').modal('show');
	}
	//成功弹窗
	function alertMsgSuccess(title){
		$('#modal-15 p').each(function(index){
			if(index==0){
				$(this).html("<font>"+title+"</font>");
			}
		})
		$('#modal-15').modal('show');
	}
</script>
<!-- footer开始 -->
<div class="footer">
    <p>北京网视通联科技股份有限公司</p>
    <p>地址：北京市海淀区知春路京仪孵化器D座3层</p>
    <p>Copyright © 2004-2014 CCHVC云通-CDN全业务平台版权所有</p>
    <p>京ICP备14002150号-1 京公网安备1101080213237号</p>
</div>

<script src="${BASE_PATH}/static/business/js/jquery.js"></script>
<script src="${BASE_PATH}/static/business/js/bootstrap.min.js"></script>
<script src="${BASE_PATH}/static/business/js/public.js"></script>
<!-- 日期控件 -->
<script type="text/javascript" src="${BASE_PATH}/static/business/js/moment.min.js"></script>
<script type="text/javascript" src="${BASE_PATH}/static/business/js/daterangepicker.js"></script> 

<!-- 拖拽进度条 -->
<script type="text/javascript" src="${BASE_PATH}/static/business/js/jquery-ui.js"></script>
<script type="text/javascript" src="${BASE_PATH}/static/business/js/slides.js"></script>
</body>
</html>